import request from '@/utils/request'


export interface albumsModel {
    albumCoverPath: string
    albumId: number
    albumPlayCount: number
    albumSubscript: number
    albumTitle: string
    albumTrackCount: number
    albumUrl: string
    albumUserNickName: string
    anchorGrade: number
    anchorId: number
    anchorUrl: string
    intro: string
    isDeleted: boolean
    isFinished: number
    isPaid: boolean
    logoType: number
    mvpGrade: number
}
export interface newListModel {
    albums: albumsModel[]
    pageNum: number
    pageSize: number
    total: number
}


export interface hotTracksModel {
    albumCoverPath: string
    albumId: number
    albumTitle: string
    anchorId: number
    anchorName: string
    breakSecond: number
    coverLarge: string
    coverMiddle: string
    coverPath: string
    coverSmall: string
    createDateFormat: string
    duration: number
    id: number
    index: number
    intro: string
    isLike: boolean
    isPaid: boolean
    isVideo: boolean
    isVipFirst: boolean
    joinXimi: boolean
    length: number
    playCount: number
    priceOp: string
    showCommentBtn: boolean
    showForwardBtn: boolean
    showLikeBtn: boolean
    showShareBtn: boolean
    tag: number
    text: string
    title: string
    trackId: number
    uid: number
    uploadId: string
    url: string
    videoCover: string
    ximiVipFreeType: number
}
export interface hotTrackModel {
    hotTracks: hotTracksModel[]
}
export interface limitedTimeFreeAlbumsModel {
    coverPath: string
    customTitle: string
    id: number
    playCount: number
    shortIntro: string
    title: string
    uid: number
}
export interface limitedFreeAlbumModel{
    limitedTimeFreeAlbums: limitedTimeFreeAlbumsModel[]
    remainingTime: number
}
export interface freeListModel {
    hotTrack: hotTrackModel
    limitedFreeAlbum: limitedFreeAlbumModel
}


export default {
    // 首页-新人必听
    getNewListen(pageNum: number, pageSize: number) {
        return request.get<any, newListModel>(`/revision/category/v2/albums?pageNum=${pageNum}&pageSize=${pageSize}&sort=1`)
    },
    // 限时免费
    getFreeList() {
        return request.get <any, freeListModel>(`/web-site/main/page`)
    }
}